<template>
	<popmanager :show="show" :type="type" :show-overlay="overlay" @tap="handleMaskClick">
		<slot></slot>
	</popmanager>

</template>

<script>
	import popmanager from './popmanager.vue'
	export default {

		onLoad: function(e) {
		},
		components: {
			popmanager
		},
		props: {
			show: {
				type: Boolean,
				value: false
			},

			overlay: {
				type: Boolean,
				value: true
			},

			closeOnClickOverlay: {
				type: Boolean,
				value: true
			},

			// 弹出方向
			type: {
				type: String,
				value: 'center'
			}
		},
		data() {
			return {

			};
		},

		methods: {
			handleMaskClick: function() {
				this.triggerEvent('click-overlay', {});

				if (!this.data.closeOnClickOverlay) {
					return;
				}
				this.triggerEvent('close', {});
			}
		}
	}
</script>

<style>

</style>
